package cn.gailvlun.gll.chatlib.message;

import android.support.annotation.Nullable;



public enum MessageStatus {
    UPLOADING(0),
    SUCCESS(1),
    FAIL_SPINNER(2),
    FAIL_RESEND(3),
    FAIL_UPLOAD(4);

    MessageStatus(int value) {
        this.value = value;
    }

    private int value;

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    @Nullable
    public static MessageStatus getMessageStatusByValue(int value) {
        for (MessageStatus messageStatus: values()) {
            if (value == messageStatus.getValue()) {
                return messageStatus;
            }
        }
        return null;
    }
}
